<?php
echo $this->adminToolBar('specialtext', 'index', '/admin/specialtext/add/', '/admin/specialtext/edit/', '/admin/specialtext/delete/', '');
?> 
<?php         
$this->title = "specialtexts";
$this->headTitle($this->title);
?>
<div class="mid-content" id="grid_specialtext">
    <table class="box-table-a" width="100%"> 
        <tr>
            <th scope="col" width="20%">Title</th>
            <th scope="col" width="20%">Title (ru)</th>
            <th scope="col" width="50%">Parent ID</th>
            <th scope="col" width="50%">Active</th>
            <th scope="col" width="5%">&nbsp;</th>  
            <th scope="col" width="5%">&nbsp;</th>  
        </tr>
        <?php foreach($this->Specialtext_arr as $specialtext) : ?>
        <tr>
            <td><?php echo $specialtext['title'];?></td>
            <td><?php echo $specialtext['title_ru'] ;?></td>
            <td><?php echo $specialtext['parentid'] ;?></td>
            <td><?php echo $specialtext['status'] ;?></td>
            <td><a href="javascript: void(0);" onclick="loadPage('/admin/specialtext/edit/id/<?php echo $specialtext['id']; ?>');" title="Edit"><img src="/images/admin/icons/edit.gif" alt=""/></a></td>
            <td><a rel="" onclick="deletespecialtext('<?php echo $specialtext['id'];?>')" href="javascript: void(0);"><img src="/images/admin/icons/disable.gif" alt=""/></a></td>
        </tr>
        <?php endforeach; ?>
    </table>
</div>
<script type="text/javascript">
 
function deletespecialtext(id)
{
    if(confirm("Are you sure that you want to delete this record?"))
        {
            
		$.ajax({
			type: "POST",
			url: '/admin/specialtext/delete/',
			data: ({id:id}),
	    	        success: function(data, textStatus, XMLHttpRequest){
	    	   	if(data != '') {
                               alert(data);
                             //  alert("successfully Added the   features");
	    			loadPage('/admin/specialtext');
	    	   	}
	    	},
	    	complete: function complete(XMLHttpRequest, textStatus){
	            $("#loader_area").hide();
	        }
		});

        }
}

</script>